import 'package:flutter/material.dart';
import 'package:fwanandroid/ui/MyColors.dart';
import 'dart:ui';

import 'package:fwanandroid/ui/home/HomePage.dart';
import 'package:fwanandroid/ui/home/NavigationPage.dart';
import 'package:fwanandroid/ui/home/ProjectPage.dart';
import 'package:fwanandroid/ui/home/SquarePage.dart';
import 'package:fwanandroid/ui/home/SystemPage.dart';

class HomeTabPage extends StatefulWidget {
  const HomeTabPage({super.key});

  @override
  State<HomeTabPage> createState() => _HomeTabPageState();
}

class _HomeTabPageState extends State<HomeTabPage> {
  @override
  Widget build(BuildContext context) {
    // 简写
    return const DefaultTabController(
        length: 5,
        child: SafeArea(
          child: Scaffold(
            appBar: PreferredSize(
              preferredSize: Size.fromHeight(56),
              child: Material(
                color: Colors.white,
                child: TabBar(
                  labelColor: MyColors.leiMuBlue,
                  indicatorColor: MyColors.leiMuBlue,
                  tabs: [
                    Tab(
                      text: "首页",
                    ),
                    Tab(
                      text: "广场",
                    ),
                    Tab(
                      text: "最新项目",
                    ),
                    Tab(
                      text: "体系",
                    ),
                    Tab(
                      text: "导航",
                    ),
                  ],
                ),
              ),
            ),
            body: const TabBarView(
              children: [
                HomePage(),
                SquarePage(),
                ProjectPage(),
                SystemPage(),
                NavigationPage(),
              ],
            ),
          ),
        ));
  }
}
